home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-10-11 | 3.4 KB | 175 lines | [TEXT/CWIE] |
- // CAboutDialog.cp -- dialog methods
-
- #include "CAboutDialog.h"
-
- #include <UEnvironment.h>
- #include <UReanimator.h>
- #include <URegistrar.h>
- #include <LStream.h>
- #include <LTabGroup.h>
- #include <LPushButton.h>
- #include <LAMPushButtonImp.h>
- #include <LGAPushButtonImp.h>
- #include <LStaticText.h>
- #include <LAMStaticTextImp.h>
- #include <LGAStaticTextImp.h>
- #include <CTextUtils.h>
-
- #include "TemperatureCmds.h"
- #include <PP_Messages.h>
-
-
- #define PPob_AboutDialogID 202
- #define RidL_AboutDialogID 202
-
- Boolean CAboutDialog::sIsRegistered = false;
-
- //----------
- CAboutDialog* CAboutDialog::CreateAboutDialog (
- LCommander* inSuperCommander,
- CommandT inCommand)
- {
- if (!sIsRegistered) {
- RegisterClass ();
- }
- CAboutDialog* dlog;
- dlog = ((CAboutDialog *)LWindow::CreateWindow(PPob_AboutDialogID, inSuperCommander));
- dlog->mCommand = inCommand;
-
- return dlog;
- }
-
- //----------
- #define RegisterClasses(AbstractClass,AMImpClass,GAImpClass) \
- RegisterClass_(AbstractClass); \
- if (useAppearance) { \
- RegisterClassID_(AMImpClass, AbstractClass::imp_class_ID); \
- } else { \
- RegisterClassID_(GAImpClass, AbstractClass::imp_class_ID); \
- }
-
- //----------
- void CAboutDialog::RegisterClass ()
- {
- Boolean useAppearance = UEnvironment::HasFeature (env_HasAppearance);
-
- RegisterClass_(CAboutDialog);
-
- // register the pane classes we use
- RegisterClasses (LPushButton, LAMPushButtonImp, LGAPushButtonImp);
- RegisterClasses (LStaticText, LAMStaticTextImp, LGAStaticTextImp);
-
- sIsRegistered = true;
- }
-
- //----------
- CAboutDialog::CAboutDialog (
- LStream* inStream)
- : LGADialog (inStream)
- {
- }
-
- //----------
- CAboutDialog::~CAboutDialog()
- {
- }
-
- //----------
- // This member function gets called once the containment hierarchy that contains
- // this pane has been built. It gives us a chance to get data members for
- // interesting subviews, and to do other operations now that our subviews exist.
- void CAboutDialog::FinishCreateSelf()
- {
- LGADialog::FinishCreateSelf();
-
- mOKButton = (LPushButton*) FindPaneByID ('OK ');
-
-
- UReanimator::LinkListenerToControls(this, this, RidL_AboutDialogID);
- // the purpose is to "connect" self to whatever controls
- // that we want to "listen" to
-
- // any additional initialization for your dialog:
-
- }
-
- //----------
- void CAboutDialog::DataChanged (
- long inDataID)
- {
- StopListening ();
-
-
- StartListening ();
- }
-
- //----------
- void CAboutDialog::ListenToMessage (
- MessageT inMessage,
- void *ioParam)
- {
- switch (inMessage) {
- case msg_OK:
- GetSuperCommander()->ProcessCommand(-mCommand, this);
- break;
-
- case msg_Cancel:
- DoClose();
- break;
-
-
- default:
- ; // do something
- break;
- }
- }
-
- //----------
- Boolean CAboutDialog::ObeyCommand (
- CommandT inCommand,
- void* ioParam)
- {
- Boolean cmdHandled = true;
-
- if (inCommand < 0) {
- // modal dialog has finished
-
- switch (-inCommand) {
- }
-
- } else {
- switch (inCommand) {
-
- default:
- cmdHandled = LGADialog::ObeyCommand(inCommand, ioParam);
- break;
- }
- }
-
- return cmdHandled;
- }
-
- //----------
- void CAboutDialog::FindCommandStatus (
- CommandT inCommand,
- Boolean &outEnabled,
- Boolean &outUsesMark,
- Char16 &outMark,
- Str255 outName)
- {
- outUsesMark = false;
-
- switch (inCommand) {
-
- // +++ Add cases here for the commands you handle
-
- default:
- LGADialog::FindCommandStatus(inCommand, outEnabled,
- outUsesMark, outMark, outName);
- break;
- }
- }
-
- // following functions will be obsoleted
- // retained only for backwards compatibility
-